<template>
  <div class="rose-echart"><HyEchart :options="option"></HyEchart></div>
</template>

<script setup lang="ts">
import HyEchart from '@/base-ui/HyEchart/hy-echart.vue';
import type { IDataType } from './types';
import { computed } from 'vue';
const props = defineProps<{
  roseData: IDataType[];
}>();
const option = computed(() => {
  return {
    // legend: {
    //   top: 'bottom'
    // },
    tooltip: {
      trigger: 'item'
    },
    toolbox: {
      show: true,
      feature: {
        mark: { show: true },
        dataView: { show: true, readOnly: false },
        restore: { show: true },
        saveAsImage: { show: true }
      }
    },
    series: [
      {
        name: '分类商品数量(玫瑰图)',
        type: 'pie',
        radius: [20, 150],
        center: ['50%', '50%'],
        roseType: 'area',
        itemStyle: {
          borderRadius: 8
        },
        data: props.roseData
      }
    ]
  };
});
</script>

<style scoped></style>
